﻿@model MusicOnLine.Models.Artist

@{
    ViewBag.Title = "Edit";
    Layout = "~/Views/Shared/_Layoutback.cshtml";
}

<h2>Edit</h2>
<meta enctype="multipart/form-data" />

<style type="text/css">
     input{ vertical-align:middle; margin:0; padding:0}
    .file-box{ position:relative;width:340px; margin-top:5px;}
    .txt{ height:18px; border:1px solid #ABADB3; width:180px;}
    .btn{ background-color:#FFF; border:1px solid #ABADB3;height:20px; width:70px;}
    .file{ position:absolute; top:0; right:80px; height:24px; filter:alpha(opacity:0);opacity: 0;width:260px }
</style>

@using (Html.BeginForm("Edit", "ManageSinger", FormMethod.Post, new { enctype = "multipart/form-data", id = "fileImgUrl" }))
{
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>Artist</legend>

        @Html.HiddenFor(model => model.ID)

        <div class="editor-label">
            @Html.LabelFor(model => model.ArtistName)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.ArtistName)
            @Html.ValidationMessageFor(model => model.ArtistName)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.ImgUrl)
        </div>
        <div class="editor-field">
                <div>
                    <div style="width:120px;  border-radius:5px; line-height:120px; border:solid 1px gray; overflow:hidden; text-align:center;">
                        <img style="max-height:122px; max-width:122px; vertical-align:middle;" src="@Url.Content("~/SingerImg/"+Model.ImgUrl)" />
                    </div>
                </div>
          <div class="file-box">
              @Html.TextBoxFor(model=>model.ImgUrl)            
             <input type='button' class='btn' value='浏览...' />
             <input type="file" name="fileImgUrl" class="file" id="fileImgUrl" size="28" onchange="document.getElementById('ImgUrl').value=this.value" />
             @Html.ValidationMessageFor(model => model.ImgUrl)
            </div>
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.ArtistSex)
        </div>
        <div class="editor-field">           
            @Html.RadioButtonFor(model => model.ArtistSex,"未知") 未知
            @Html.RadioButtonFor(model=>model.ArtistSex,"男") 男
            @Html.RadioButtonFor(model => model.ArtistSex, "女") 女
            @Html.ValidationMessageFor(model => model.ArtistSex)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.StartWith)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.StartWith)
            @Html.ValidationMessageFor(model => model.StartWith)
        </div>
        @Html.HiddenFor(o=>o.CreateBy)
        @Html.HiddenFor(o=>o.CreateDate)
        <p>
            <input type="submit" value="保存" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("返回列表", "Index")
</div>
<br />

<script type="text/javascript">
    $(document).ready(function () {
        $("#divManageSinger").addClass("currentMenu");
    })
</script>